<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String id = request.getParameter("id");
%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>角色人员管理</title>
	<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="../css/pop-page.css" />
	<script type="text/javascript" src="../easyui/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="../js/win.js"></script>
	<script type="text/javascript">
		function addRoleUsers(){
			openUrl("新增人员", 500, 430, "selectUser2.jsp");
		}
		
		function deleteRoleUser(){
			checkSelectSomeDoAction("#dg", "删除", "角色人员", "../role/removeRoleUsers.do?id=<%=id%>", true);
		}
		
		function selectUsers(ids){
			closeWin();
			$.ajax({
				   type: "POST",
				   url: "../role/addRoleUsers.do",
				   dataType: "text",
				   data:{id:<%=id%>, ids:ids},
				   success: function(result){
					   if (result == "success") {
				        	$("#dg").datagrid("reload");
				        }
				   }
			});
		}
	</script>
</head>
<body>
	<div class="dg-content">
		<table id="dg" class="easyui-datagrid" title="人员列表"
			data-options="rownumbers:true,
				fitColumns:true,iconCls:'icon-table',url:'../role/listRoleUsers.do?id=<%=id %>'">
			<thead>
				<tr>
					<th data-options="field:'ck',checkbox:true"></th>
					<th data-options="field:'id',hidden:true"></th>
					<th data-options="field:'name',width:60,align:'center'">名称</th>
					<th data-options="field:'username',width:60,align:'left'">用户名</th>
				</tr>
			</thead>
		</table>
	</div>
	<div class="dg-foot">
		<div class='dg-toolbar'>
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" 
				plain="true" onclick="addRoleUsers()">新增</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" 
				plain="true" onclick="deleteRoleUser()">删除</a>
		</div>
	</div>
</body>
</html>